package com.ctshk.rpc.order.tour.dto;

import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 系列团游客签证记录
 * </p>
 *
 * @author 谭响
 * @since 2021-01-22
 */
@Data
@ApiModel(value="系列团游客签证记录详情DTO", description="系列团游客签证记录详情DTO")
public class SeriesOrderTouristVisaDetailDTO implements Serializable {

    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "所属订单")
    private Long orderId;

    @ApiModelProperty(value = "游客ID")
    private Long touristId;

    @ApiModelProperty(value = "签证费用")
    private BigDecimal visaAmount;

    @ApiModelProperty(value = "证件收集状态")
    private Integer collectionStatus;

    @ApiModelProperty(value = "是否需补齐资料")
    @Deprecated
    private Integer needSupplyInfo;

    @ApiModelProperty(value = "提交运单号")
    private String submitTrackingNumber;

    @ApiModelProperty(value = "提交人")
    private Long submitUserId;

    @ApiModelProperty(value = "提交时间")
    private LocalDateTime submitTime;

    @ApiModelProperty(value = "补齐人")
    private Long makeUpUserId;

    @ApiModelProperty(value = "补齐时间")
    private LocalDateTime makeUpTime;

    @ApiModelProperty(value = "补齐运单号")
    private String makeUpTrackingNumber;

    @ApiModelProperty(value = "出签状态")
    private Integer signOutStatus;

    @ApiModelProperty(value = "出签运单号")
    private String signOutTrackingNumber;

    @ApiModelProperty(value = "出签时间")
    private LocalDateTime signOutTime;

    @ApiModelProperty(value = "送签时间")
    private LocalDateTime sendTime;

    @ApiModelProperty(value = "缺失资料名称")
    private String missingCertificate;

    @ApiModelProperty(value = "建议提交时间")
    private LocalDateTime adviseSubmitTime;

    @ApiModelProperty(value = "第一步备注")
    private String step1Remark;

    @ApiModelProperty(value = "第二步备注")
    private String step2Remark;

    @ApiModelProperty(value = "出签快递时间")
    private LocalDateTime signOutExpressTime;

    @ApiModelProperty(value = "出签回执文件")
    private String signOutReceiptFile;

    @ApiModelProperty(value = "出签签证文件JSON")
    private List<String> signOutFilesJson;

    public void setSignOutFilesJson(String signOutFilesJson) {
        this.signOutFilesJson =  new ArrayList<>();
        if(StringUtils.isNotBlank(signOutFilesJson)) {
            List<String> strings = JSON.parseArray(signOutFilesJson, String.class);
            this.signOutFilesJson.addAll(strings);
        }
    }
}
